set more 1

/*
File:	cepr_basic_educ.do
Date:	Nov 21, 2006
	Feb 15, 2008
	Oct 29, 2008
	Feb 10, 2009
	Jan 4, 2010
	Feb 22, 2011
	Jan 3, 2012
	Jan 3, 2013
	Dec 20, 2013
	Mar 12, 2015, CEPR ORG Version 2.0
	Apr  1, 2015, CEPR ORG Version 2.0.1
	March 1, 2016, CEPR ORG Version 2.1
	Oct 12, 2016, CEPR ORG Version 2.1.1
	Feb 9, 2017, CEPR ORG Version 2.2
	Apr 21, 2017, CEPR ORG Version 2.2.1
	Apr 10, 2018, CEPR ORG Version 2.3
	Mar 22, 2019, CEPR ORG Version 2.4
	Jul 24, 2019, CEPR ORG Version 2.4.1
	Feb 05, 2020, CEPR ORG Version 2.5
	
Desc:	Creates consistent educational variables for CEPR consistent
	extract	of Basic CPS; includes post-1992 education variable in
	original format
Note:	See copyright notice at end of program.
*/

/* note: any pre-1994 data processing is not yet correct;
         use only to process data from 1994 forward
*/

/* Determine data year */
local year=year in 1


/* Jaeger (1997) categories */
	
if 1979<=`year' & `year'<=1990 {
gen byte educ=1 if 1<=gradeat & gradeat<=11
replace educ=1 if gradeat==12 & gradecp==2 /* didn't complete 12th */
replace educ=2 if gradeat==12 & gradecp==1 /* completed 12th */
replace educ=3 if 13<=gradeat & gradeat<=15
replace educ=3 if gradeat==16 & gradecp==2 /* didn't complete college */
replace educ=4 if gradeat==16 & gradecp==1 /* completed college */
replace educ=4 if gradeat==17 /* "completed 4 or 5 years college" */
replace educ=5 if 18<=gradeat & gradeat~=.

gen years_educ=gradeat
}
if `year'==1991 {
gen byte educ=1 if 1<=adhga & adhga<=11
replace educ=1 if adhga==12 & adhgc==2 /* didn't complete 12th */
replace educ=2 if adhga==12 & adhgc==1 /* completed 12th */
replace educ=3 if 13<=adhga & adhga<=15
replace educ=3 if adhga==16 & adhgc==2 /* didn't complete college */
replace educ=4 if adhga==16 & adhgc==1 /* completed college */
replace educ=4 if adhga==17 /* "completed 4 or 5 years college" */
replace educ=5 if 18<=adhga & adhga~=.

gen years_educ=adhga
}
if 1992<=`year' & `year'<=1993 {
gen byte educ=1 if 31<=grade92 & grade92<=37
replace educ=2 if 38<=grade92 & grade92<=39 /* includes "no diploma" */
replace educ=3 if 40<=grade92 & grade92<=42
replace educ=4 if grade92==43
replace educ=5 if 44<=grade92 & grade92<=46

gen years_educ=0 if grade92==31
replace years_educ=2.5 if grade92==32
replace years_educ=5.5 if grade92==33
replace years_educ=7.5 if grade92==34
replace years_educ=9 if grade92==35
replace years_educ=10 if grade92==36
replace years_educ=11 if grade92==37
replace years_educ=11 if grade92==38
replace years_educ=12 if grade92==39
replace years_educ=13 if grade92==40
replace years_educ=14 if grade92==41
replace years_educ=14 if grade92==42
replace years_educ=16 if grade92==43
replace years_educ=18 if grade92==44
replace years_educ=19 if grade92==45
replace years_educ=21 if grade92==46
}
if 1994<=`year' & `year'<=2020 {
gen byte educ=1 if 31<=peeduca & peeduca<=37
replace educ=2 if 38<=peeduca & peeduca<=39 /* includes "no diploma" */
replace educ=3 if 40<=peeduca & peeduca<=42
replace educ=4 if peeduca==43
replace educ=5 if 44<=peeduca & peeduca<=46

gen years_educ=0 if peeduca==31
replace years_educ=2.5 if peeduca==32
replace years_educ=5.5 if peeduca==33
replace years_educ=7.5 if peeduca==34
replace years_educ=9 if peeduca==35
replace years_educ=10 if peeduca==36
replace years_educ=11 if peeduca==37
replace years_educ=11 if peeduca==38
replace years_educ=12 if peeduca==39
replace years_educ=13 if peeduca==40
replace years_educ=14 if peeduca==41
replace years_educ=14 if peeduca==42
replace years_educ=16 if peeduca==43
replace years_educ=18 if peeduca==44
replace years_educ=19 if peeduca==45
replace years_educ=21 if peeduca==46
}
lab var educ "Education level"
#delimit ;
lab define educ
1 "LTHS"
2 "HS"
3 "Some college"
4 "College"
5 "Advanced"
;
#delimit cr
lab val educ educ
notes educ: Follows Jaeger (1997) classifications
notes educ: CPS: derived from a-hga, a-hgc, peeduca

/* 
   See David A. Jaeger, "Reconciling the Old and New Census Bureau Education
   Questions: Recommendations for Researchers," Journal of Business & Economic
   Statistics, vol. 15, no. 3 (July 1997), pp. 300-309.
   
   (1) "It is important to note that individuals who attended, but did not
   complete, a 13th year of school are counted as having some college because
   these individuals are often included among individuals with 12 years of
   school rather than as college attenders. The match between the old and
   new recoded variables is improved by including these individuals among
   individuals with some college experience, however, because 74.5% of them
   report 'Some college but no degree' on the new question."(p. 305)
   
   (2) "I recommend that individuals who reported finishing 16 or 17 years
   of education be recoded into a '4 or 5 years college' category. ...[T]he
   match is improved by including individuals who completed 17 years with
   those who completed 16 years. Among individuals who reported attending
   17 years of school with the old question, 57.9% reported receiving only
   a bachelor's degree with the new question, and 35.3% reported receiving
   a master's degree or higher." (p. 305)

   (3) "The categories '12th grade, no diploma' and 'High school graduate'
   are both recoded into '12th grade.' Individuals who reported completing
   12th grade without receiving a diploma with the new questions were more
   likely than not (55.3%) to report finishing 12th grade with the old
   question."(p. 305)     
*/

/* post-1991 education categories */

if 1979<=`year' & `year'<=1991 {
gen byte educ92=.
}
if 1992<=`year' & `year'<=1993 {
gen byte educ92=grade92-30 /* converts 31-46 to 1-16 */
}
if 1994<=`year' & `year'<=2020 {
gen byte educ92=peeduca-30 /* converts 31-46 to 1-16 */
replace educ92=. if educ92<0
}

lab var educ92 "Education level, post-1991"
#delimit ;
lab define educ92
1  "Less than 1st grade"
2  "1st-4th grade"
3  "5th-6th grade"
4  "7th-8th grade"
5  "9th grade"
6  "10th grade"
7  "11th grade"
8  "12th grade-no diploma"
9  "HS graduate, GED"
10 "Some college but no degree"
11 "Associate degree-occupational/vocational"
12 "Associate degree-academic program"
13 "Bachelor's degree"
14 "Master's degree"
15 "Professional school"
16 "Doctorate"
;
#delimit cr
lab val educ92 educ92
notes educ92: Follows Jaeger (1997) classifications
notes educ92: CPS: derived from peeduca, a-hga



/* 
Copyright 2020 CEPR and John Schmitt

This file is part of the cepr_org_master.do program. This file and all
programs referenced in it are free software. You can redistribute the
program or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
USA.
*/

